package org.btik.light.tool.type;

public class StringUtil {

    public static final int CHAR_UP_STEP = 'a' - 'A';

    public static String safeValue(String str) {
        return null == str ? "" : str;
    }

    public static String toFirstCharUp(String str) {
        char firstChar = str.charAt(0);
        if (firstChar >= 'a' && firstChar <= 'z') {
            char[] chars = str.toCharArray();
            chars[0] = (char) (firstChar - CHAR_UP_STEP);
            return new String(chars);
        }
        return str;
    }

    public static boolean isEmpty(String str) {
        return null == str || str.isEmpty();
    }


}
